package io.renren.modules.sys.controller;

import io.renren.common.utils.R;
import io.renren.modules.sys.entity.SysClazzEntity;
import io.renren.modules.sys.service.impl.SysClazzServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sys/clazz")
public class SysClazzController {


    @Autowired
    SysClazzServiceImpl sysClazzService;

    @GetMapping("findClazzByTeacherId/{teacherid}")
    public SysClazzEntity findClazzByTeacherId(@PathVariable Integer teacherid){
        return sysClazzService.findClazzByTeacherId(teacherid);
    }

    /**
     * 查询机构列表
     */
    @GetMapping("findClassAll")
    public R classAll(){
        List<SysClazzEntity> list = sysClazzService.findClassAll();

        return R.ok().put("list", list);
    }
}
